package com.yang.designmode.ActionMode.chainResponsibility;

public class Client {
    public static void main(String[] args) {
        Handler handlerA = new ConcreteHandlerA();
        Handler handlerB = new ConcreteHandlerB();

        handlerA.setNextHandler(handlerB);

        // 发送请求
        handlerA.handleRequest("A"); // 输出: ConcreteHandlerA 处理了请求
        handlerA.handleRequest("B"); // 输出: ConcreteHandlerB 处理了请求
    }
}
